package com.ljy.tkmodel.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.ljy.tkmodel.entity.CourseClassification;
import com.ljy.tkmodel.mapper.CourseClassificationMapper;
import com.ljy.tkmodel.service.CourseClassificationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@Service
public class CourseClassificationServiceImpl extends ServiceImpl<CourseClassificationMapper, CourseClassification> implements CourseClassificationService {
    @Autowired
    RedisTemplate redisTemplate;
    @Override
    public int insertCourseClassification(CourseClassification classification) {
           if (classification != null) {
               return baseMapper.insert(classification);
           }
             return 0;
    }

    @Override
    public List<CourseClassification> selectCourseClassification(Map map) {
        if (CollectionUtil.isEmpty(map)) {
            return baseMapper.selectList(null);
        } else {
            //todo 条件查询课程分类
            return null;
        }

    }
}
